Skip to content

Make prefix circuit-breaker test deterministic#144171

Merged
drempapis merged 2 commits intoelastic:mainfrom
drempapis:fix/prefix-query-breaker-test-flakiness
Mar 16, 2026
Merged

Make prefix circuit-breaker test deterministic#144171
drempapis merged 2 commits intoelastic:mainfrom
drempapis:fix/prefix-query-breaker-test-flakiness

Conversation

@drempapis
Copy link
Copy Markdown
Contributor

@drempapis drempapis commented Mar 13, 2026

The testPrefixCircuitBreakerTripsWithLowLimit was flaky.

It sometimes did not throw CircuitBreakingException because part of the query was random (randomBoolean()), so memory usage could stay below the breaker limit.

This change makes the test deterministic by always using case-insensitive prefix clauses with longer prefix values, so the breaker reliably trips.

Solves #143548

@elasticsearchmachine elasticsearchmachine added v9.4.0 needs:triage Requires assignment of a team area label labels Mar 13, 2026
@drempapis drempapis added >test-failure Triaged test failures from CI Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch :Search Foundations/Search Catch all for Search Foundations and removed needs:triage Requires assignment of a team area label labels Mar 13, 2026
@elasticsearchmachine elasticsearchmachine added the needs:risk Requires assignment of a risk label (low, medium, blocker) label Mar 13, 2026
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-search-foundations (Team:Search Foundations)

@drempapis drempapis added >test Issues or PRs that are addressing/adding tests and removed >test-failure Triaged test failures from CI needs:risk Requires assignment of a risk label (low, medium, blocker) labels Mar 13, 2026
Copy link
Copy Markdown
Contributor

@spinscale spinscale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My assumption here is that the case insensitive automaton is bigger and thus ensures, that the breaker accounts more memory, plus making sure the string has a certain length?

@drempapis
Copy link
Copy Markdown
Contributor Author

My assumption here is that the case insensitive automaton is bigger and thus ensures, that the breaker accounts more memory, plus making sure the string has a certain length?

That's correct

@drempapis drempapis added auto-backport Automatically create backport pull requests when merged v8.19.0 v9.2.0 v9.3.0 labels Mar 16, 2026
@drempapis drempapis merged commit c6fafa5 into elastic:main Mar 16, 2026
35 of 36 checks passed
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

💔 Backport failed

Status Branch Result
8.19 Commit could not be cherrypicked due to conflicts
9.2 Commit could not be cherrypicked due to conflicts
9.3 Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 144171

drempapis added a commit to drempapis/elasticsearch that referenced this pull request Mar 16, 2026
(cherry picked from commit c6fafa5)

# Conflicts:
#	muted-tests.yml
@drempapis
Copy link
Copy Markdown
Contributor Author

💚 All backports created successfully

Status Branch Result
9.3
9.2
8.19

Questions ?

Please refer to the Backport tool documentation

drempapis added a commit to drempapis/elasticsearch that referenced this pull request Mar 16, 2026
(cherry picked from commit c6fafa5)

# Conflicts:
#	muted-tests.yml
drempapis added a commit to drempapis/elasticsearch that referenced this pull request Mar 16, 2026
(cherry picked from commit c6fafa5)

# Conflicts:
#	muted-tests.yml
elasticsearchmachine pushed a commit that referenced this pull request Mar 16, 2026
* fix test (#144171)

(cherry picked from commit c6fafa5)

# Conflicts:
#	muted-tests.yml

* Add new muted tests and remove obsolete ones
elasticsearchmachine pushed a commit that referenced this pull request Mar 16, 2026
(cherry picked from commit c6fafa5)

# Conflicts:
#	muted-tests.yml
elasticsearchmachine pushed a commit that referenced this pull request Mar 16, 2026
(cherry picked from commit c6fafa5)

# Conflicts:
#	muted-tests.yml
ncordon pushed a commit to ncordon/elasticsearch that referenced this pull request Mar 16, 2026
szybia added a commit to szybia/elasticsearch that referenced this pull request Mar 16, 2026
…elocations

* upstream/main: (33 commits)
  Unmute InferenceRestIT and DefaultEndPointsIT (elastic#144217)
  feat: add keep_alive to async task status (elastic#144010)
  Add explicit isNoOpUpdate() method to MapperService (elastic#144113)
  Always attach APM Agent (elastic#144120)
  Fix random_score nightly tests (elastic#144176)
  Add nested query checks for disabled sequence numbers (elastic#144185)
  Return sentinel values from Fetch when sequence numbers are disabled (elastic#144212)
  [Test] Test peer-recovery with sequence numbers pruning (elastic#144116)
  Remove `scaled-*` field assertions from mixed cluster downsampling test (elastic#144295)
  Refactor: Use range syntax in ES|QL exponential histogram tests (elastic#144110)
  Move resolve aliases to IndexAbstractionOptions (elastic#143953)
  unmute test (elastic#144299)
  Fix approximation csvtests (elastic#144233)
  fix test (elastic#144171)
  Add int4 vector scoring benchmarks (elastic#144105)
  Mute org.elasticsearch.xpack.esql.qa.single_node.GenerativeIT test elastic#143023
  Mute org.elasticsearch.test.apmintegration.MetricsApmIT testApmIntegration {withOTel=false} elastic#144282
  Native cli launcher (elastic#143712)
  Mute org.elasticsearch.xpack.esql.qa.multi_node.GenerativeIT test elastic#143023
  Mute org.elasticsearch.xpack.esql.heap_attack.HeapAttackSubqueryIT testManyRandomKeywordFieldsInSubqueryIntermediateResults elastic#144274
  ...
michalborek pushed a commit to michalborek/elasticsearch that referenced this pull request Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged :Search Foundations/Search Catch all for Search Foundations Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch >test Issues or PRs that are addressing/adding tests v8.19.0 v9.2.0 v9.3.0 v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants